package com.example.first;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class configActivity extends AppCompatActivity {
        EditText dollarText;
        EditText euroText;
        EditText wonText;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_config);
        Intent intent=getIntent();
        float dollar2=intent.getFloatExtra("dollar_key",0.0f);
        float euro2=intent.getFloatExtra("euro_key",0.0f);
        float won2=intent.getFloatExtra("won_key",0.0f);
        dollarText=(EditText) findViewById(R.id.dollar_r);
        euroText=(EditText) findViewById(R.id.euro_r);
        wonText=(EditText) findViewById(R.id.won_r);
        dollarText.setText(String.valueOf(dollar2));
        euroText.setText(String.valueOf(euro2));
        wonText.setText(String.valueOf(won2));
    }
        public void cli(View btn){
            float d=Float.parseFloat(dollarText.getText().toString());
            float e=Float.parseFloat(euroText.getText().toString());
            float w=Float.parseFloat(wonText.getText().toString());
            Intent intent2=new Intent(this,RateActivity.class);
            intent2.putExtra("key_dollar",d);
            intent2.putExtra("key_euro",e);
            intent2.putExtra("key_won",w);
            setResult(2,intent2);
            finish();
        }
}